package com.caigou.modules.query.ui

import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.caigou.comm.base.constants.RouterPath
import com.caigou.comm.base.container.BaseActivity
import com.caigou.modules.query.R
import com.caigou.modules.query.databinding.ActivityQueryWelcomeBinding
import dagger.hilt.android.AndroidEntryPoint

/**
 * @author #Suyghur.
 * Created on 2021/12/22
 */
@Route(path = RouterPath.Query.PAGE_WELCOME)
@AndroidEntryPoint
class QueryWelcomeActivity : BaseActivity() {
    private lateinit var binding: ActivityQueryWelcomeBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityQueryWelcomeBinding.inflate(layoutInflater)
        setContentView(binding.root)
        containerId = binding.queryWelcomeLlContainer.id
        initView()
    }

    private fun initView() {
        initQueryFeature()

        binding.queryWelcomeTvBack.setOnClickListener {
            finish()
        }
    }

    private fun initQueryFeature() {
        binding.queryItemAssistant.apply {
            featureIvIcon.setImageResource(R.drawable.img_query_assistant)
            featureTvDesc.text = "挑码助手"
            root.setOnClickListener {
                ARouter.getInstance().build(RouterPath.Query.PAGE_ASSISTANT).navigation()
            }
        }

        binding.queryItemLotteryTime.apply {
            featureIvIcon.setImageResource(R.drawable.img_query_lottery_time)
            featureTvDesc.text = "开奖日期"
            root.setOnClickListener {
                ARouter.getInstance().build(RouterPath.Query.PAGE_LOTTERY_DATE).navigation()
            }
        }

        binding.queryItemColdHot.apply {
            featureIvIcon.setImageResource(R.drawable.img_query_cold_hot)
            featureTvDesc.text = "冷热号码查询"
            root.setOnClickListener {
                ARouter.getInstance().build(RouterPath.Query.PAGE_COLD_HOT).navigation()
            }
        }

        binding.queryItemSenseQuery.apply {
            featureIvIcon.setImageResource(R.drawable.img_query_sense_query)
            featureTvDesc.text = "六合常识查询"
            root.setOnClickListener {
                ARouter.getInstance().build(RouterPath.Query.PAGE_SENSE).navigation()
            }
        }

        binding.queryItemLingMa.apply {
            featureIvIcon.setImageResource(R.drawable.img_query_ling_ma)
            featureTvDesc.text = "生肖灵码表"
            root.setOnClickListener {
                ARouter.getInstance().build(RouterPath.Query.PAGE_LING_MA).navigation()
            }
        }

        binding.queryItemLongestCode.apply {
            featureIvIcon.setImageResource(R.drawable.img_query_longest_code)
            featureTvDesc.text = "历史最久不开"
            root.setOnClickListener {
                ARouter.getInstance().build(RouterPath.Query.PAGE_LONGEST_CODE).navigation()
            }
        }
    }
}